<html>

<head>
<meta http-equiv="Content-Language" content="en-us"/>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0"/>
<meta name="ProgId" content="FrontPage.Editor.Document"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Filesystem Deprecated Features</title>
<link href="styles.css" rel="stylesheet"/>
</head>

<body>

<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
  <tr>
    <td width="277">
<a href="../../../index.htm">
<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" width="300" height="86" border="0"/></a></td>
    <td align="middle">
    <font size="7">Filesystem Deprecated Features</font>
    </td>
  </tr>
</table>

<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse"
 bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
  <tr>
    <td><a href="index.htm">Home</a> &nbsp;&nbsp;
    <a href="tutorial.html">Tutorial</a> &nbsp;&nbsp;
    <a href="reference.html">Reference</a> &nbsp;&nbsp;
    <a href="faq.htm">FAQ</a> &nbsp;&nbsp;
    <a href="release_history.html">Releases</a> &nbsp;&nbsp;
    <a href="portability_guide.htm">Portability</a> &nbsp;&nbsp;
    <a href="v4.html">V4</a> &nbsp;&nbsp;
    <a href="v3.html">V3 Intro</a> &nbsp;&nbsp;
    <a href="v3_design.html">V3 Design</a> &nbsp;&nbsp;
    <a href="deprecated.html">Deprecated</a> &nbsp;&nbsp;
    <a href="issue_reporting.html">Bug Reports </a>&nbsp;&nbsp;
    </td>
  </tr>
</table>

<h2><a name="Deprecated-names">Deprecated names and features</a></h2>
<p style="font-size: 10pt">As the library evolves over time, names sometimes
change or old features are removed to make way for new features. To ease transition, Boost.Filesystem deprecates
the old names and features, but by default continues to provide many of them.
The deprecated names and other workarounds can be suppressed by defining macro <code>
BOOST_FILESYSTEM_NO_DEPRECATED</code>, and this is recommended for all new code.</p>
<p style="font-size: 10pt">In the table, &#10004; indicates a synonym or other
workaround is provided unless <code>
BOOST_FILESYSTEM_NO_DEPRECATED</code> is defined.</p>
<p style="font-size: 10pt">Additionally, when not disabled, most of the deprecated components will generate
compilation warnings when used. These warnings are intended to highlight the library usage that
needs to be updated. For convenience during the transition period, these warnings
can be suppressed by defining <code>BOOST_FILESYSTEM_ALLOW_DEPRECATED</code> macro.</p>
<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
  <tr>
    <td style="font-size: 10pt" valign="top">
    <b><i>Component or location</i></b></td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt"><b><i>Old name, now deprecated</i></b></p></td>
    <td style="font-size: 10pt" valign="top">
    &#10004;</td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt"><b><i>New name</i></b></p></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt">Construction, assignment and appending from container types.</p></td>
    <td style="font-size: 10pt" valign="top">
    &nbsp;</td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt">Use string types or iterators as the source for path construction, assignment and appending.</p></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>path.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>template&lt;class String, class Traits&gt;<br/>
&nbsp; class basic_path;</code></td>
    <td style="font-size: 10pt" valign="top">
    &nbsp;</td>
    <td style="font-size: 10pt" valign="top">
    Class template <code>basic_path</code> is replaced by class <code>path</code>.
    No workaround for an explicitly coded <code>basic_path</code> is provided,
    but see the next row - <code>path</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>path.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>typedef basic_path&lt;std::string, path_traits&gt; path</code></td>
    <td style="font-size: 10pt" valign="top">
    &#10004;</td>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>operations.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>initial_path()</code></td>
    <td style="font-size: 10pt" valign="top">
    &#10004;</td>
    <td style="font-size: 10pt" valign="top">
    Function removed. Cache <code>current_path()</code> early in the application startup.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    Build system</td>
    <td style="font-size: 10pt" valign="top">
    <code>Auto-linking on Windows</code></td>
    <td style="font-size: 10pt" valign="top">
    &nbsp;</td>
    <td style="font-size: 10pt" valign="top">
    No longer supported. When users are linking against static library of Boost.Filesystem,
    they are recommended to explicitly add Boost.Filesystem dependencies to their linker command
    line. Shared library of Boost.Filesystem is not affected by this as it is already linked with
    all its dependencies.</td>
  </tr>
</table>

<p>Some library features were removed in one of the past releases. The table below lists some of
those features along with suggested replacements.</p>

<table border="1" cellpadding="5" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111">
  <tr>
    <td style="font-size: 10pt" valign="top">
    <b><i>Component or location</i></b></td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt"><b><i>Removed name</i></b></p></td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt"><b><i>Possible replacement</i></b></p></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>branch_path()</code></td>
    <td style="font-size: 10pt" valign="top"><code>parent_path()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>directory_string()</code></td>
    <td style="font-size: 10pt" valign="top"><code>string</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>external_directory_string()</code></td>
    <td style="font-size: 10pt" valign="top"><code>native()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>external_file_string()</code></td>
    <td style="font-size: 10pt" valign="top"><code>native()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>file_string()</code></td>
    <td style="font-size: 10pt" valign="top"><code>string()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>has_branch_path()</code></td>
    <td style="font-size: 10pt" valign="top"><code>has_parent_path()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>has_leaf()</code></td>
    <td style="font-size: 10pt" valign="top"><code>has_filename()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>is_complete()</code></td>
    <td style="font-size: 10pt" valign="top"><code>is_absolute()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class path</code></td>
    <td style="font-size: 10pt" valign="top"><code>leaf()</code></td>
    <td style="font-size: 10pt" valign="top"><code>filename()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>native_directory_string()</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>string()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>native_file_string()</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>string()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>normalize()</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>p.normalize()</code> with <code>p = p.lexically_normal()</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt"><code>remove_leaf()</code></p></td>
    <td style="font-size: 10pt" valign="top">
    <p style="font-size: 10pt"><code>remove_filename()</code></p></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>path.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>typedef basic_path&lt;std::wstring, wpath_traits&gt; wpath</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>class path</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>convenience.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>std::string extension(const path&amp; p)</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>extension(p)</code> with <code>p.extension().string()</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>convenience.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>std::string basename(const path&amp; p)</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>basename(p)</code> with <code>p.stem().string()</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>convenience.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>path change_extension(const path&amp; p, const path&amp; new_extension)</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>path new_p = change_extension(p, ext);</code> with <code>path new_p = p; new_p.replace_extension(ext);</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>operations.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <p dir="ltr"><code>template &lt;class Path&gt;<br/>
    Path complete(const Path&amp; p,<br/>
&nbsp;const Path&amp; base=<br/>
&nbsp;&nbsp; initial_path&lt;Path&gt;())</code></p></td>
    <td style="font-size: 10pt" valign="top">
    <p dir="ltr"><code>path absolute(const path&amp; p, const path&amp; base=<br/>
&nbsp; current_path())</code></p></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>operations.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>is_regular(file_status f)</code></td>
    <td style="font-size: 10pt" valign="top">
    <p dir="ltr">
    <code>is_regular_file(file_status f)</code></p></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>operations.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>symbolic_link_exists(const path&amp; ph)</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>symbolic_link_exists(p)</code> with <code>is_symlink(symlink_status(p))</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>operations.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>copy_directory(const path&amp; from, const path&amp; to)</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>create_directory(const path&amp; to, const path&amp; from)</code>. Note the reversed order of arguments.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class directory_entry</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>filename()</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>de.filename()</code> with <code>de.path().filename()</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class directory_entry</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>leaf()</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>de.leaf()</code> with <code>de.path().filename()</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>class directory_entry</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>string()</code></td>
    <td style="font-size: 10pt" valign="top">
    Replace <code>de.string()</code> with <code>de.path().string()</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
    <td style="font-size: 10pt" valign="top"><code>level()</code></td>
    <td style="font-size: 10pt" valign="top"><code>depth()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
    <td style="font-size: 10pt" valign="top"><code>no_push_pending()</code></td>
    <td style="font-size: 10pt" valign="top"><code>!recursion_pending()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>class recursive_directory_iterator</code></td>
    <td style="font-size: 10pt" valign="top"><code>no_push()</code></td>
    <td style="font-size: 10pt" valign="top"><code>disable_recursion_pending()</code></td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top"><code>directory.hpp</code></td>
    <td style="font-size: 10pt" valign="top"><code>enum class symlink_option</code></td>
    <td style="font-size: 10pt" valign="top">Use corresponding values of <code>enum class directory_options</code> instead.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>directory.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    <code>wrecursive_directory_iterator</code> typedef</td>
    <td style="font-size: 10pt" valign="top">
    <code>class recursive_directory_iterator</code>.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>operations.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    The header provides <code>filesystem_error</code>, <code>file_status</code>, <code>directory_entry</code>, <code>directory_iterator</code>, <code>recursive_directory_iterator</code> and associated enums and functions.</td>
    <td style="font-size: 10pt" valign="top">
    Explicitly include headers <code>exception.hpp</code>, <code>file_status.hpp</code> and/or <code>directory.hpp</code> to introduce the required components.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>path_traits.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    The header contained implementation details of class <code>path</code>.</td>
    <td style="font-size: 10pt" valign="top">
    Remove the include.</td>
  </tr>
  <tr>
    <td style="font-size: 10pt" valign="top">
    <code>convenience.hpp</code></td>
    <td style="font-size: 10pt" valign="top">
    The header contained helper functions that were deprecated and then removed.</td>
    <td style="font-size: 10pt" valign="top">
    Remove the include.</td>
  </tr>
</table>

<h2>Deprecation rationale</h2>
<h3><code>initial_path</code> function</h3>
<p dir="ltr">Full implementation of <code>initial_path()</code> would require
support from the C++ runtime startup code, and that doesn't seem likely to
happen. Depending on the user to call <code>initial_path()</code> at the
beginning of <code>main()</code> is too error prone.&nbsp; An equivalent
function can trivially be provided by a user.</p>

<hr/>

<p>&copy; Copyright Beman Dawes, 2002-2005, 2010</p>
<p>&copy; Copyright Andrey Semashev, 2019-2024</p>
<p> Use, modification, and distribution are subject to the Boost Software
License, Version 1.0. See <a href="http://www.boost.org/LICENSE_1_0.txt">
www.boost.org/LICENSE_1_0.txt</a></p>

</body>

</html>
